 <!--通用search搜索页面  -->
<template>
  <div class="page_search">
    <my-form :formConfig="searchFormConfig" v-model="formaDataModel" @input="handleInput">
      <template #header>
        <div class="title">
          高级检索
        </div>
      </template>
      <template #footer>
        <div class="footer_btns">
          <el-button type="primary" size="small" icon="el-icon-search" @click="handleSearch">搜索</el-button>
          <el-button size="small" icon="el-icon-refresh" @click="handleReset">重置</el-button>
        </div>
      </template>
    </my-form>
  </div>
</template>
<script>
import MyForm from '@/base-ui/table/my-form.vue'
export default {
  props: {
    searchFormConfig: {
      required: true
    },
    associateModel: {

      default: () => { }
    }
  },
  components: { MyForm },
  data() {
    return {
      formaDataModelOrigin: {},
      formaDataModel: {}
    }
  },
  created() {
    this.init()
  },
  methods: {
    init() {

      let formItems = this.searchFormConfig?.formItems
      for (const formItem of formItems) {
        this.formaDataModelOrigin[formItem.field] = ''

      }
      this.formaDataModel = JSON.parse(JSON.stringify(this.formaDataModelOrigin))


    },
    handleReset() {
      this.formaDataModel = this.formaDataModelOrigin
      this.$emit('resetBtnClick')
    },
    handleSearch() { },

    handleInput() {

    }
  },

}


</script>
<style lang='less' scoped>
.title {
  text-align: center;
  font-weight: 600;
  line-height: 30px;
  padding: 10px 0;
}

.footer_btns {
  text-align: right;
  position: relative;
  right: 10px;
  bottom: 15px;

}
</style>
